﻿using System;
using ATM.Terminal.Rendering.Base;

namespace ATM.Terminal.Screens.Base
{
    public abstract class ScreenBase
    {
        public abstract void Render(RenderTargetBase renderTarget);
        public abstract void ProcessInput(ConsoleKeyInfo input);

        public delegate void ScreenChangeHandler(ScreenBase screen);
        public event ScreenChangeHandler OnScreenChange;

        protected virtual void RaiseScreenChange(ScreenBase screen)
        {
            var handler = OnScreenChange;
            if (handler != null) handler(screen);
        }
    }
}
